package Common

import(
	"gin/Config"
)

func IsTest() int {
    return 0;
}

func GetEntityClass(index_type int) string {
    switch index_type {
    case 100:
        return "企业"
    case 101:
        return "机构"
    case 200:
        return "人物"
    case 300:
        return "国际"
    case 400:
        return "科学"
    case 500:
        return "文化"
    case 600:
        return "社会"
    }
    return "其它"
}

func GetEntityName(index_type int) string {
    switch index_type {
    case 0:
        return "股票"
    case 1:
        return "基金"
    case 2:
        return "十大股东"
    }
    return "Error"
}

func GetEntityType(index_name string) int {
    switch index_name {
    case "股票":
        return 0
    case "基金":
        return 1
    case "十大股东":
        return 2
    }
    return 0
}

func GetEntityNameByClass(class_id int) string {
    name,err := Config.EntityClassMap[class_id]
    if err {
        return name
    } else {
        return "其它"
    }
}

func GetOverallType(overall_type int) string {
    name,err := Config.RelationMap[overall_type]
    if err {
        return name
    } else {
        return "其它"
    }

    switch overall_type {
    case 100:
        return "中国政策"
    case 200:
        return "美国政策"
    case 900:
        return "体育盛事"
    case 2100:
        return "大宗商品"
    case 2150:
        return "自然灾害"
    case 2200:
        return "指数"
    case 2300:
        return "企业动态"
    case 2400:
        return "节假日"
    }
    return "其它"
}


func GetRelation03Id(name string) int {
    switch name {
        case "调价":
            return 3001
        case "处罚":
            return 3002
        case "诉讼":
            return 3003
    }
    return 3000
}

func GetRelation03Name(id int) string {
    switch id {
        case 3001:
            return "调价"
        case 3002:
            return "处罚"
        case 3003:
            return "诉讼"
    }
    return "其它"
}

func IsTiaojia(id int) bool {
    return id==3001
}

func IsChufa(id int) bool {
    return id==3002
}

func IsSusong(id int) bool {
    return id==3003
}

const (
    Timeline_overall = iota // 0
    Timeline_market
)

const (
    AttrV3_tiaojia = 3001
    AttrV3_chufa   = 3002
    AttrV3_susong  = 3003
    AttrV3_diaoyan  = 3004
    AttrV3_chanyelian  = 3005
    AttrV3_guanli  = 3006
    AttrV3_yeji  = 3007
    AttrV3_other   = 3999
)

const (
    Order_inc = 0
    Order_desc = 1
)


